/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package commands;

import java.util.logging.Level;
import java.util.logging.Logger;
import servidorped.Conexion;
import servidorped.User;
import servidorped.UserListFactory;

/**
 *
 * @author Micosil
 */
public class who implements Command{

    @Override
    public boolean execute(String[] stringlist, User user) {
        user.getUserSender().setToSendln("Connected users:");
        Logger.getGlobal().log(Level.INFO, "User {0} requested information about other users.", user.getUserName());
        for (User oneUser: UserListFactory.getList().getConnectedUsers()){
            user.getUserSender().setToSendln(oneUser.getUserName());
        }
        return true;
    }
    
}
